//
//  VideoToAudioViewController.m
//  RecorderDemo
//
//  Created by zhangbaochuan on 2020/9/3.
//  Copyright © 2020 xuxiwen. All rights reserved.
//

#import "GeexAVSeparation.h"
#import "PlayerManager.h"

#import "VideoToAudioViewController.h"

@interface VideoToAudioViewController ()

@property (nonatomic, strong) NSURL *outputPath;
@end

@implementation VideoToAudioViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    [GeexAVSeparation accessAudioFromVideo:self.videoUrl completion:^(NSURL * _Nonnull outputPath, BOOL isSucceed) {
        self.outputPath = outputPath;
    }];
    
    
}

- (IBAction)btnm4aPlay:(id)sender {
    [[PlayerManager sharedInstance] playWithVoiceURL:self.outputPath];
}

- (IBAction)btnMp3Action:(id)sender {
    NSURL *outputURL = [NSURL fileURLWithPath:[GeexAVSeparation getPathMP3]];
    [[PlayerManager sharedInstance] playWithVoiceURL:outputURL];
}

@end
